package com.soecode.wxtools.bean;

import com.soecode.wxtools.api.WxConsts;
import com.soecode.wxtools.util.xml.XStreamCDataConverter;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import lombok.Data;

@Data
public class WxXmlOutMusicMessage extends WxXmlOutMessage {

    @XStreamAlias("Music")
    protected final Music music = new Music();

    public WxXmlOutMusicMessage() {
        this.msgType = WxConsts.XML_MSG_MUSIC;
    }

    public String getTitle() {
        return music.title;
    }

    public void setTitle(String title) {
        music.title = title;
    }

    public String getDescription() {
        return music.description;
    }

    public void setDescription(String description) {
        music.description = description;
    }

    public String getMusicUrl() {
        return music.musicUrl;
    }

    public void setMusicUrl(String musicUrl) {
        music.musicUrl = musicUrl;
    }

    public String gethQMusicUrl() {
        return music.hQMusicUrl;
    }

    public void sethQMusicUrl(String hQMusicUrl) {
        music.hQMusicUrl = hQMusicUrl;
    }

    public String getThumbMediaId() {
        return music.thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        music.thumbMediaId = thumbMediaId;
    }

    @Data
    @XStreamAlias("Music")
    public static class Music {
        @XStreamAlias("Title")
        @XStreamConverter(value = XStreamCDataConverter.class)
        private String title;

        @XStreamAlias("Description")
        @XStreamConverter(value = XStreamCDataConverter.class)
        private String description;

        @XStreamAlias("MusicUrl")
        @XStreamConverter(value = XStreamCDataConverter.class)
        private String musicUrl;

        @XStreamAlias("HQMusicUrl")
        @XStreamConverter(value = XStreamCDataConverter.class)
        private String hQMusicUrl;

        @XStreamAlias("ThumbMediaId")
        @XStreamConverter(value = XStreamCDataConverter.class)
        private String thumbMediaId;
    }
}
